I would like to have the kflop automatically reduce the FRO if the spindle speed and/or load feedback indicates it is overloaded or less than the commanded spindle speed.
Commanded spindle speed is set via a persist variable, and FRO is set via the "SetFRO" script command. I'm not sure how to get a hook in to further reduce the commanded FRO if necessary, while still remembering the commanded FRO so it can be eventually resumed.
I could change the PC side to use a persist variable for FRO instead of using the script command, in which case the kflop thread would decide the actual FRO based on that plus the spindle speed ratio. But is there a better way?
There's a SetFROTemp() function, but that overrides feed hold which I don't want. Also, the spindle ratio override should be applied as a further reduction of the commanded FRO, not replace it.
Motivation: the spindle we are using is very high speed but it takes a while to spin up, so we want to ramp up the feed override rather than plunge ahead immediately. Also, if it ever gets overloaded we want to detect that and reduce the feed rate accordingly. In the worst case, if it stalls, we want to stop to avoid damaging the bearings.